<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as AuthUser;
//按钮组
use App\Models\Traits\Btn;
class User extends AuthUser
{
    //使用软删除
    use SoftDeletes;
    //引入按钮组
    use Btn;
    
    //定义软删除字段
    protected $dates = ['deleted_at'];

    //设置添加的字段
    //拒绝不添加的字段
    //设置黑名单
    protected $guarded = [];

    //退出登录的时候不要验证rember_token
    protected $rememberTokenName = '';

    //隐藏字段
    protected $hidden = ['password'];

    //角色 属于
    //找到当前用户模型对应的这条角色数据  role_id = id
    public function role(){
        return $this->belongsTo(Role::class,'role_id');
    }
}
